<ion-view id="entrustView" view-title="委托" class="p-gray-bg entrust-content">
        <ion-nav-bar class="bar-energized">
        </ion-nav-bar>
        <div class="loader-center" ng-if="!doneLoading">
            <div class="loader">
                <i class="icon ion-loading-c"></i>
            </div>
        </div>

        <ion-content has-bouncing="true" class="has-header has-footer"
                     delegate-handle="userMessageScroll">

            <div ng-repeat="message in messages track by $index" class="message-wrapper"
                 on-hold="onMessageHold($event, $index, message)">

                <div ng-if="user._id !== message.userId">
                    <img ng-click="viewProfile(message)" class="profile-pic left"
                         ng-src="{{message.pic}}" onerror="onProfilePicError(this)" />

                    <div class="chat-bubble left" ng-click="viewProfile(message)">

                        <div class="message" ng-bind-html="message.text | nl2br" autolinker>
                        </div>

                        <div class="message-detail">
                            <span am-time-ago="message.date"></span>
                        </div>

                    </div>
                </div>

                <div ng-if="user._id === message.userId">

                    <img ng-click="viewProfile(message)" class="profile-pic right"
                         ng-src="{{user.pic}}" onerror="onProfilePicError(this)" />

                    <div class="chat-bubble right" ng-click="viewProfile(message)">

                        <div class="message" ng-bind-html="message.text | nl2br" autolinker>
                        </div>

                        <div class="message-detail">
                            <span ng-show="message.audioPath">{{message.audioPath}}</span>
                            <span am-time-ago="message.date"></span>
                        </div>

                    </div>

                </div>

                <div class="cf"></div>

            </div>

            <div ng-hide="messages.length > 0" class="text-center light">
                <div class="spacer5"></div>
                <div class="text1_5">
                    <p><span>全球最智能财务助理</span></p>
                </div>
                <div class="half-spacer"></div>
                <div class="text2">
                    <p><span>我可以帮您购买</span></p>
                    <p><span>全球任何一款理财产品</span></p>
                </div>
                <div class="half-spacer"></div>
                <div>
                    <img src="img/dahuatong.png" width="40%" />
                </div>
            </div>
        </ion-content>

        <form name="sendMessageForm" ng-submit="sendMessage(sendMessageForm)" novalidate>
            <ion-footer-bar class="item-input-inset" keyboard-attach>
                <div class="footer-btn-wrap">
                    <button class="button button-icon icon ion-mic-a footer-btn" type="submit" ng-click="setSendMode(1)"
                            ng-disabled="SendMode==1">
                    </button>
                </div>
                <label class="item-input-wrapper" ng-show="SendMode==0">
                    <textarea class="" ng-model="input.message" value="" placeholder="给我们发信息..." required minlength="1" maxlength="1500" msd-elastic></textarea>
                </label>
                <label class="item-audio-wrapper" ng-show="SendMode==1">
                    <button class="button button-block button-assertive" id="btnRecord">按住 说话</button>
                </label>
                <div class="footer-btn-wrap" ng-show="SendMode==0">
                    <button class="button button-icon icon ion-android-send footer-btn" type="submit"
                            ng-disabled="!input.message || input.message === ''">
                    </button>
                </div>
                <div class="footer-btn-wrap" ng-show="SendMode==1">
                    <button class="button button-icon icon ion-edit footer-btn" type="button" ng-click="setSendMode(0)">
                    </button>
                </div>
            </ion-footer-bar>
        </form>

    </ion-view>